const fs = require('fs');
const http = require('http');
const mime = require('mime');
const path = require('path');

// const stream = fs.createReadStream('demo.json');
// stream.on('data', chunk => {
//   console.log(chunk);
// });

// stream.on('end', () => {
//   console.log('finished');
// });

const server = http.createServer();

server.on('request', (req, res) => {
  res.writeHead(200, { 'Content-Type': 'image/png' });
  fs.createReadStream('./image.png').pipe(res);
});

server.listen(3000);

// import obj from './server03';
// const obj = require('./server03');
// console.log(obj);
